package tlias.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tlias.pojo.*;
import tlias.dto.*;
import tlias.service.ReportService;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;

    // 5.1 员工性别统计
    @GetMapping("/empGenderData")
    public Result empGenderStatistics() {
        log.info("员工性别统计");
        List<StatisticsItemDTO> result = reportService.getEmpGenderStatistics();
        return Result.success(result);
    }

    // 5.2 员工职位人数统计
    @GetMapping("/empJobData")
    public Result empJobStatistics() {
        log.info("员工职位人数统计");
        JobStatisticsDTO result = reportService.getEmpJobStatistics();
        return Result.success(result);
    }

    // 5.3 学员学历统计
    @GetMapping("/studentDegreeData")
    public Result studentDegreeStatistics() {
        log.info("学员学历统计");
        List<StatisticsItemDTO> result = reportService.getStudentDegreeStatistics();
        return Result.success(result);
    }

    // 5.4 班级人数统计
    @GetMapping("/studentCountData")
    public Result studentCountStatistics() {
        log.info("班级人数统计");
        ClazzCountDTO result = reportService.getStudentCountStatistics();
        return Result.success(result);
    }
}